\(\int \cos ^3(e+f x) (a+b \sec ^2(e+f x)) \, dx\) [156]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 30 \[ \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {(a+b) \sin (e+f x)}{f}-\frac {a \sin ^3(e+f x)}{3 f} \]

[Out]

(a+b)*sin(f*x+e)/f-1/3*a*sin(f*x+e)^3/f

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4129, 3092} \[ \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {(a+b) \sin (e+f x)}{f}-\frac {a \sin ^3(e+f x)}{3 f} \]

[In]

Int[Cos[e + f*x]^3*(a + b*Sec[e + f*x]^2),x]

[Out]

((a + b)*Sin[e + f*x])/f - (a*Sin[e + f*x]^3)/(3*f)

Rule 3092

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[-f^(-1), Subst[I
nt[(1 - x^2)^((m - 1)/2)*(A + C - C*x^2), x], x, Cos[e + f*x]], x] /; FreeQ[{e, f, A, C}, x] && IGtQ[(m + 1)/2
, 0]

Rule 4129

Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Int[(C + A*Sin[e + f*
x]^2)/Sin[e + f*x]^(m + 2), x] /; FreeQ[{e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && ILtQ[(m + 1)/2, 0]

Rubi steps \begin{align*} \text {integral}& = \int \cos (e+f x) \left (b+a \cos ^2(e+f x)\right ) \, dx \\ & = -\frac {\text {Subst}\left (\int \left (a+b-a x^2\right ) \, dx,x,-\sin (e+f x)\right )}{f} \\ & = \frac {(a+b) \sin (e+f x)}{f}-\frac {a \sin ^3(e+f x)}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.67 \[ \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {b \cos (f x) \sin (e)}{f}+\frac {b \cos (e) \sin (f x)}{f}+\frac {a \sin (e+f x)}{f}-\frac {a \sin ^3(e+f x)}{3 f} \]

[In]

Integrate[Cos[e + f*x]^3*(a + b*Sec[e + f*x]^2),x]

[Out]

(b*Cos[f*x]*Sin[e])/f + (b*Cos[e]*Sin[f*x])/f + (a*Sin[e + f*x])/f - (a*Sin[e + f*x]^3)/(3*f)

Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.03

method result size
parallelrisch \(\frac {\sin \left (3 f x +3 e \right ) a +9 \left (a +\frac {4 b}{3}\right ) \sin \left (f x +e \right )}{12 f}\) \(31\)
derivativedivides \(\frac {\frac {a \left (\cos \left (f x +e \right )^{2}+2\right ) \sin \left (f x +e \right )}{3}+\sin \left (f x +e \right ) b}{f}\) \(33\)
default \(\frac {\frac {a \left (\cos \left (f x +e \right )^{2}+2\right ) \sin \left (f x +e \right )}{3}+\sin \left (f x +e \right ) b}{f}\) \(33\)
risch \(\frac {3 a \sin \left (f x +e \right )}{4 f}+\frac {\sin \left (f x +e \right ) b}{f}+\frac {a \sin \left (3 f x +3 e \right )}{12 f}\) \(40\)
norman \(\frac {\frac {2 \left (a -3 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 f}-\frac {2 \left (a -3 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{3 f}-\frac {2 \left (a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {2 \left (a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{f}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )}\) \(111\)

[In]

int(cos(f*x+e)^3*(a+b*sec(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/12*(sin(3*f*x+3*e)*a+9*(a+4/3*b)*sin(f*x+e))/f

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.93 \[ \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {{\left (a \cos \left (f x + e\right )^{2} + 2 \, a + 3 \, b\right )} \sin \left (f x + e\right )}{3 \, f} \]

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

1/3*(a*cos(f*x + e)^2 + 2*a + 3*b)*sin(f*x + e)/f

Sympy [F]

\[ \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right ) \cos ^{3}{\left (e + f x \right )}\, dx \]

[In]

integrate(cos(f*x+e)**3*(a+b*sec(f*x+e)**2),x)

[Out]

Integral((a + b*sec(e + f*x)**2)*cos(e + f*x)**3, x)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.90 \[ \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=-\frac {a \sin \left (f x + e\right )^{3} - 3 \, {\left (a + b\right )} \sin \left (f x + e\right )}{3 \, f} \]

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/3*(a*sin(f*x + e)^3 - 3*(a + b)*sin(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.13 \[ \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=-\frac {a \sin \left (f x + e\right )^{3} - 3 \, a \sin \left (f x + e\right ) - 3 \, b \sin \left (f x + e\right )}{3 \, f} \]

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

-1/3*(a*sin(f*x + e)^3 - 3*a*sin(f*x + e) - 3*b*sin(f*x + e))/f

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.93 \[ \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=-\frac {\frac {a\,{\sin \left (e+f\,x\right )}^3}{3}-\sin \left (e+f\,x\right )\,\left (a+b\right )}{f} \]

[In]

int(cos(e + f*x)^3*(a + b/cos(e + f*x)^2),x)

[Out]

-((a*sin(e + f*x)^3)/3 - sin(e + f*x)*(a + b))/f